//
//  MessageData.swift
//  XGamesLive
//
//  Created by ios on 2024/5/27.
//

import Foundation
import SmartCodable


enum XGLMessageStatus {
    case Sending
    case Failed
    case Success
    
    static func status(_ value: NSInteger)->XGLMessageStatus{
        switch value {
        case 0:
            return .Sending
        case 1:
            return .Failed
        case 2:
            return .Success
        default:
            return .Success
        }
    }
}

struct XGL_MessageChatData: Codable, SmartCodable {
    var userId: String = ""
    var header: String = ""
    var name: String = ""
    var time: String = ""
    var content: String?
    var cover: Data?
    var videoPath: URL?
    ///0: text 1: image 2: video 3: gift 4: date
    var messageType: NSInteger = 0
    ///0 sending 1 failed 2 success
    var status: NSInteger = 2
    var messageId: String = UUID().uuidString
}
